<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>form表单</title>
		<link rel="stylesheet" href="/adminSite/css/X-ui.css" />
		<link rel="stylesheet" href="/adminSite/css/article-xq.css" />
		<!--[if lt IE 9]>
			<script type="text/javascript" src="/adminSite/js/html5.js"></script>
		<![endif]-->
	</head>
	<body>
		<ol class="breadcrumb-nav">
			<li>
				<a href="">主页</a>
			</li>
			<li>
				文章列表
			</li>
		</ol>
		<div class="pd-20">
			<table class="table table-h table-border table-bg table-bordered mt-20">
				<thead>
					<tr>
						<th style="width:50px">序号</th>
						<th>栏目名称</th>
						<th>发布时间</th>
						<th>简介</th>
						<th>是否隐藏</th>
						<th style="width:150px">操作</th>
					</tr>
				</thead>
				<tbody class="text-c">
					<% if(column.length){%>
						<% column.forEach(function(data , index){ %>
						<tr>
							<td><%= index+1 %></td>
							<td><%= data.name %></td>
							<td><%= ejsExtend.getDate(data.pubdate) %></td>
							<td><%= data.briefing %></td>
							<td><%= data.isShow %></td>
							<td>
								<a data-id="<%= data.id %>" href="javascript:;" class="delete">删除</a>
								<a href="">编辑</a>
							</td>
						</tr>
						<% }) %>
					<% } %>
				</tbody>
			</table>
		</div>
		<div class="pd-20">
			<a href="/admin/addColumn" class="btn">添加栏目</a>
		</div>
		<script type="text/javascript" src="/adminSite/js/jquery-1.11.0.js" ></script>
		<script type="text/javascript" src="/adminSite/js/extend/X-ui-modal/js/X-ui-modal.js" ></script>
		<script>
			$(function(){
				$(".text-c .delete").click(function(){
					var th = $(this);
					XuiModal().confirm("是否确定删除" , function(){
						var data = {id : th.data("id")};
						$.post("/admin/ColumnDel" , data , function(data){
							if(data.state == "ok"){
								XuiModal().msg("删除成功" , {icon : 4} , function(){
									window.location.reload();
								});
							}else{
								XuiModal().msg(data.message , {icon : 2});
							};
						},"JSON");
					});
				});
			})
		</script>
	</body>
</html>
